<template>
	<view class="">
		<j-cell-group>
			<view class="" v-if="false">
				<j-cell title="上锁功能" :more="false" subTitle="打开此功能后，可以在预览页面增加闭锁功能按钮。此功能需要设备支持。">
					<view slot="tips" style="margin-right:20rpx;">
						<switch :checked="true" color="#FF0025" style="transform:scale(0.8)">
						</switch>
					</view>
				</j-cell>
			</view>
			<view class="" style="margin-top:20rpx;">
				<j-cell title="手动开锁" :more="false" subTitle="打开此功能后，可以在主页面增加开锁功能按钮。此功能需要设备支持。">
					<view slot="tips" style="margin-right:20rpx;">
						<switch :checked="isManualUnlocking" color="#FF0025" style="transform:scale(0.8)"
							@change="manualUnlockingChange">
						</switch>
					</view>
				</j-cell>
			</view>
			<view class="" v-if="false" style="margin-top:20rpx;">
				<j-cell title="隐私保护" :more="false" subTitle="打开此功能后，开锁时需要使用手机的指纹或PIN码。">
					<view slot="tips" style="margin-right:20rpx;">
						<switch :checked="true" color="#FF0025" style="transform:scale(0.8)">
						</switch>
					</view>
				</j-cell>
			</view>
		</j-cell-group>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isManualUnlocking: false
			}
		},
		onLoad(opt) {
			if (uni.getStorageSync('manualUnlocking') == '0') {
				this.isManualUnlocking = false;
			} else {
				this.isManualUnlocking = true;
			}
		},
		methods: {
			manualUnlockingChange(e) {
				if (e.detail.value == false) {
					uni.setStorageSync('manualUnlocking', '0')
				} else {
					uni.setStorageSync('manualUnlocking', '1')
				}
			}
		}
	}
</script>

<style lang="less" scoped>
	/deep/.cell-sub-title {
		word-break: break-all;
		word-wrap: break-word;
		white-space: pre-wrap;
		max-width: 70vw;
	}
</style>
